package com.zzl.alligator.management.system.service.impl;


import com.zzl.alligator.management.system.mapper.SysOperLogMapper;
import com.zzl.alligator.management.system.domain.SysOperLog;
import com.zzl.alligator.management.system.service.ISysOperLogService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
/**
 * 操作日志记录(SysOperLog)服务层
 *
 * @author zhouziliang
 * @since 2020-07-06
 */
@Service
public class SysOperLogService implements ISysOperLogService {
    
    @Autowired
    private SysOperLogMapper sysOperLogMapper;
    
    /**
     * 通过ID查询单条数据
     *
     * @param operId 主键
     * @return 实例对象
     */
    @Override
    public SysOperLog findSysOperLogById(Long operId) {
        return sysOperLogMapper.findSysOperLogById(operId);
    }

   /**
     * 通过实体作为筛选条件查询
     *
     * @param sysOperLog 实例对象
     * @return 对象列表
     */
    @Override
    public List<SysOperLog> findSysOperLogList(SysOperLog sysOperLog) {
        return sysOperLogMapper.findSysOperLogList(sysOperLog);
    }

    /**
     * 新增数据
     *
     * @param sysOperLog 实例对象
     * @return 实例对象
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int insertSysOperLog(SysOperLog sysOperLog) {
        return sysOperLogMapper.insertSysOperLog(sysOperLog);
    }

    /**
     * 修改数据
     *
     * @param sysOperLog 实例对象
     * @return 实例对象
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int updateSysOperLog(SysOperLog sysOperLog) {
        return sysOperLogMapper.updateSysOperLog(sysOperLog);
    }

    /**
     * 通过主键删除数据
     *
     * @param operId 主键
     * @return 是否成功
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int deleteById(Long operId) {
        return sysOperLogMapper.deleteById(operId);
    }


    /**
     * 清空数据
     *
     * @return 清除条数
     */
    @Override
    public int clean() {
        return sysOperLogMapper.clean();
    }
}